home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / networking / otpapsampleserver / otdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.1 KB  |  53 lines

  1. /*
  2.     File:        OTDebug.h
  3.  
  4.     Contains:    Macros for debugging stuff
  5.  
  6.     Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __OTDEBUG__
  11. #define __OTDEBUG__
  12.  
  13.  
  14. #define kOTFatalErr                "FB "
  15. #define kOTNonfatalErr            "NB "
  16. #define kOTExtFatalErr            "FX "
  17. #define kOTExtNonfatalErr        "NX "
  18. #define kOTUserFatalErr            "UF "
  19. #define kOTUserErr                "UE "
  20. #define kOTUserNonfatalErr        "UE "
  21. #define kOTInfoErr                "IE "
  22. #define kOTInfoBreak            "IN "
  23.  
  24. pascal    void OTDebugStr(const char* str);
  25.  
  26. #if qDebug || qDebug2
  27.  
  28.     #define OTDebugBreak(str)            OTDebugStr(str)
  29.     #define OTDebugTest(val, str)        { if ( val ) OTDebugStr(str); }
  30.     #define OTAssert(name, cond)                                \
  31.         if ( !(cond) )                                            \
  32.         {                                                        \
  33.             OTDebugStr(#name " - Failed assertion:" #cond);        \
  34.         }
  35.         
  36. #else
  37.  
  38.     #define OTDebugBreak(str)
  39.     #define OTDebugTest(val, str)
  40.     #define OTAssert(name, cond)
  41.  
  42. #endif    // qDebug || qDebug2
  43.  
  44. #if qDebug > 1 || qDebug2 > 1
  45.     #define OTDebugBreak2(str)            OTDebugStr(str)
  46.     #define OTDebugTest2(val, str)        { if ( val) OTDebugStr(str); }
  47. #else
  48.     #define OTDebugBreak2(str)
  49.     #define OTDebugTest2(val, str)
  50. #endif    // qDebug > 1 || qDebug2 > 1
  51.  
  52. #endif    // __OTDEBUG__
  53.